<template>
    <div>
        <button @click="showLog">测试</button>
        <!--ref用在dom标签上，获取的是dom节点，
        用在组件标签上，获取的是组件实例对象-->
        <Person ref="person"/>
    </div>
</template>

<script lang="ts" setup name="App">

import Person from "@/components/Person.vue";
import {ref} from "vue";

let person = ref()

function showLog() {
    console.log(person.value)
    person.value.updateName()
}
</script>

<style scoped>

</style>
